package day04;
import java.util.Scanner;
/* 1-输入数字的偶数和*/
public class NumberSumTest {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入您的数字");
        int num=scan.nextInt();
        int sum=0;
        for(int i=1;i<=num;i++){
            if(i%2==0){
                sum+=i;
            }
        }
        System.out.println("1到"+num+"的所有偶数和为"+sum);
    }
}
